\documentclass[a4paper,12pt]{report}
\usepackage[margin=1in]{geometry} % to change the page dimensions
\usepackage{ctex}
\usepackage{xeCJK}
\usepackage{comment}
%\usepackage{times}
\usepackage{setspace}
% \usepackage{lastpage}
\usepackage{fancyhdr}
\usepackage{graphicx}
%\graphicspath{{fig/}}
\usepackage{wrapfig}
\usepackage{subfigure}
\usepackage{array}  
% \usepackage{fontspec,xunicode,xltxtra}
% \renewcommand{\sfdefault}{cmr}
\usepackage{titlesec}
\usepackage{titletoc}
\usepackage[titletoc]{appendix}
%\usepackage[top=30mm,bottom=30mm,left=20mm,right=20mm]{geometry}
%\usepackage{cite}
\usepackage[backend = biber, style = gb7714-2015, defernumbers=true]{biblatex}
\renewcommand*{\bibfont}{\small}
\addbibresource{reference.bib}
%\usepackage{courier}
\setmonofont{Courier New}
\usepackage{listings}
\lstset{tabsize=4, keepspaces=true,
    xleftmargin=2em,xrightmargin=0em, aboveskip=1em,
    %backgroundcolor=\color{gray!20},  % 定义背景颜色
    frame=none,                       % 表示不要边框
    extendedchars=false,              % 解决代码跨页时，章节标题，页眉等汉字不显示的问题
    numberstyle=\ttfamily,
    basicstyle=\ttfamily,
    keywordstyle=\color{blue}\bfseries,
    breakindent=10pt,
    identifierstyle=,                 % nothing happens
    commentstyle=\color{green}\small,  % 注释的设置
    morecomment=[l][\color{green}]{\#},
    numbers=left,stepnumber=1,numberstyle=\scriptsize,
    showstringspaces=false,
    showspaces=false,
    flexiblecolumns=true,
    breaklines=true, breakautoindent=true,breakindent=4em,
    escapeinside={/*@}{@*/},
}
\usepackage{amsmath}
\usepackage{amsthm}
\newtheorem{theorem}{定理}
\newtheorem{definition}{定义}
\newtheorem{corollary}{推论}
\newtheorem{example}{例}
\usepackage{amsfonts}
%\usepackage{bm}
\usepackage{booktabs} % for much better looking tables
\usepackage{paralist} % very flexible & customisable lists (eg. enumerate/itemize, etc.)
\usepackage{verbatim} % adds environment for commenting out blocks of text & for better verbatim
\usepackage{subfigure} % make it possible to include more than one captioned figure/table in a single float
% These packages are all incorporated in the memoir class to one degree or another...
\usepackage{cases} %equation set
\usepackage{multirow} %use table
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{hyperref}
\hypersetup{colorlinks,linkcolor=black,anchorcolor=black,citecolor=black, pdfstartview=FitH,bookmarksnumbered=true,bookmarksopen=true,} % set href in tex & pdf
%\usepackage[framed,numbered,autolinebreaks,useliterate]{mcode} % 插入matlab代码
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt

%---------------------------------------------------------------------
%	页眉页脚设置
%---------------------------------------------------------------------
\fancypagestyle{plain}{
    \pagestyle{fancy}      %改变章节首页页眉
}

\pagestyle{fancy}
\lhead{\kaishu~课程报告~}
\rhead{\kaishu~xxx}
\cfoot{\thepage}
\titleformat{\chapter}{\centering\zihao{2}\heiti}{第\chinese{chapter}章}{1em}{}
% \titleformat{\chapter*}{\centering\zihao{-1}\heiti}
\begin{comment}
%---------------------------------------------------------------------
%	章节标题设置
%---------------------------------------------------------------------
\titleformat{\chapter}{\centering\zihao{-1}\heiti}{实验\chinese{chapter}}{1em}{}
\titlespacing{\chapter}{0pt}{*0}{*6}
\end{comment}
%---------------------------------------------------------------------
%	摘要标题设置
%---------------------------------------------------------------------
%\renewcommand{\abstractname}{摘要}
\renewcommand{\figurename}{图}
\renewcommand{\tablename}{表}

%---------------------------------------------------------------------
%	参考文献设置
%---------------------------------------------------------------------
%\renewcommand{\bibname}{\zihao{2}{\hspace{\fill}参\hspace{0.5em}考\hspace{0.5em}文\hspace{0.5em}献\hspace{\fill}}}
\renewcommand{\bibname}{参考文献}
\begin{comment}
%---------------------------------------------------------------------
%	引用文献设置为上标
%---------------------------------------------------------------------
\makeatletter
\def\@cite#1#2{\textsuperscript{[{#1\if@tempswa , #2\fi}]}}
\makeatother
\end{comment}
%---------------------------------------------------------------------
%	目录页设置
%---------------------------------------------------------------------
%\renewcommand{\contentsname}{\zihao{-3} 目\quad 录}
\renewcommand{\contentsname}{目录}
\titlecontents{chapter}[0em]{\songti\zihao{-4}}{\thecontentslabel\ }{}
{\hspace{.5em}\titlerule*[4pt]{$\cdot$}\contentspage}
\titlecontents{section}[2em]{\vspace{0.1\baselineskip}\songti\zihao{-4}}{\thecontentslabel\ }{}
{\hspace{.5em}\titlerule*[4pt]{$\cdot$}\contentspage}
\titlecontents{subsection}[4em]{\vspace{0.1\baselineskip}\songti\zihao{-4}}{\thecontentslabel\ }{}
{\hspace{.5em}\titlerule*[4pt]{$\cdot$}\contentspage}

\begin{document}
%---------------------------------------------------------------------
%	封面设置
%---------------------------------------------------------------------
\begin{titlepage}
    \begin{center}
        
    \includegraphics[width=0.60\textwidth]{nk_logo.png}\\
    \vspace{10mm}
    \textbf{\zihao{1}{\heiti{南开大学XX学院}}}\\[0.8cm]
    \textbf{\zihao{1}{\heiti{《XX学》课程报告}}}\\[3cm]
    \includegraphics[width=0.20\textwidth]{head.jpg}\\%这里是你的照片
    \vspace{\fill}
    
\setlength{\extrarowheight}{3mm}
{\songti\zihao{3}	
\begin{tabular}{rl}
    
    {\makebox[4\ccwd][s]{学\qquad 号：}} & ~\kaishu xxxx \\
    {\makebox[4\ccwd][s]{姓\qquad 名：}} & ~\kaishu xxx \\
    {\makebox[4\ccwd][s]{年\qquad 级：}} & ~\kaishu 2019级 \\
    {\makebox[4\ccwd][s]{专\qquad 业：}} & ~\kaishu xxxx \\
    {\makebox[4\ccwd][s]{授课教师：}}  & ~\kaishu xxx~教授\\ 
    {\makebox[4\ccwd][s]{课程助教：}} & ~\kaishu xxx~xxx \\
    {\makebox[4\ccwd][s]{完成日期：}}  & ~\kaishu 2019年12月19日\\ 

\end{tabular}
 }\\[2cm]
%\vspace{\fill}
%\zihao{4}
%使用\LaTeX 撰写于\today
    \end{center}	
\end{titlepage}

%---------------------------------------------------------------------
%  摘要页
%---------------------------------------------------------------------
\chapter*{摘要}
    
这里是摘要。

\textbf{关键词：}总结，理解，思考

\chapter*{Abstract}

This is abstract.

\textbf{Keywords } summary, comprehension, thinking

%---------------------------------------------------------------------
%  目录页
%---------------------------------------------------------------------
\tableofcontents % 生成目录

%---------------------------------------------------------------------
%  绪论
%---------------------------------------------------------------------
\chapter{课程理解}
\setcounter{page}{1}

\section{实验目的}

\begin{itemize}
    \item 熟悉、剖析、设计、实现直升机实验系统，获得对智能系统的基本结构及其各个组成单元的基本认识。
    \item 掌握状态反馈、观测器设计等现代控制理论。
    \item 学会运用MATLAB/Simulink 来搭建系统仿真，并在Simulink环境下实现实时控制。
    \item 学会将仿真结果与实验相结合，了解仿真和实际系统的区别与联系。
    \item 运用Word或\LaTeX 完成基本的科技报告撰写。
\end{itemize}

%---------------------------------------------------------------------
%  极点配置
%---------------------------------------------------------------------
\chapter{知识点总结} 

\section{空间描述与变换}

\begin{definition}[位姿]
    位姿是两坐标系间的相互关系，可以等价地用一个位置矢量和一个旋转矩阵来描述：$\left\{ B \right\} = \left\{ {{}_B^AR,{}^A{P_{BORG}}} \right\}$
\end{definition}

\begin{equation}
    F=ma
\end{equation}

%---------------------------------------------------------------------
%  分离原则
%---------------------------------------------------------------------
\chapter{总结与展望}

\section{深度学习方法在机械臂控制中的应用}

\cite{wilson2019learning}采用了sim-to-real learning的架构。

%---------------------------------------------------------------------
%  实验总结
%---------------------------------------------------------------------
%\titleformat{\chapter}{\centering\zihao{-1}\heiti}{}{1em}{}

%---------------------------------------------------------------------
%  参考文献设置
%---------------------------------------------------------------------
%\addcontentsline{toc}{chapter}{参考文献}

\printbibliography

\titleformat{\chapter}{\centering\zihao{2}\heiti}{附录~\Alph{chapter}}{1em}{}

\begin{appendix}

\chapter{第一部分}

\begin{lstlisting}[language=python]
print('hello world') 
\end{lstlisting}

\chapter{第二部分}

% Please add the following required packages to your document preamble:
% \usepackage{booktabs}
\begin{table}[]
    \centering
    \caption{测试结果}
    \label{tab:my-table}
    \begin{tabular}{@{}cc@{}}
    \toprule
    算法 & 准确率 \\ \midrule
    I & 0.7684 \\
    II & 0.7865 \\
    III & 0.7655 \\ \bottomrule
    \end{tabular}
\end{table}

\end{appendix}

\end{document}